
<extend name="Common/common"/>
	
<block name='content'>
<article class="page-container">
	<form action="" method="post" class="form form-horizontal" id="form-member-add">
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>任务栏目：</label>
			<div class="formControls col-xs-8 col-sm-6"> <span class="select-box">
				<select name="nav_id" class="select">
					<option value="0">选择栏目</option>
					<foreach name="navs" item="v">
					<option value="{$v['id']}" <if condition='$v["id"]==$task["nav_id"]'>selected</if> >{$v['task_nav_name']}</option>
					</foreach>
				</select>
				</span> </div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3"><span class="c-red">*</span>任务名称：</label>
			<div class="formControls col-xs-8 col-sm-6">
				<input type="text" class="input-text" value="{$task['task_name']}" placeholder="" name="task_name">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">任务数目：</label>
			<div class="formControls col-xs-8 col-sm-1">
				<input style="text-align: center;" type="text" class="input-text" value="<empty name='task'>0<else/>{$task['count']}</empty>" placeholder="" id="mobile" name="count">
			</div>
		</div>
		<div class="row cl">
			<label class="form-label col-xs-4 col-sm-3">奖励积分：</label>
			<div class="formControls col-xs-8 col-sm-1">
				<input style="text-align: center;" type="text" class="input-text" value="<empty name='task'>0<else/>{$task['reward']}</empty>" placeholder="" id="mobile" name="reward">
			</div>
		</div>
		
		<div class="row cl">
			<div class="col-xs-8 col-sm-9 col-xs-offset-4 col-sm-offset-3">
				<notempty name="task">
				<input type="hidden" name="task_id" value='{$task["id"]}'/>
				</notempty>
				<input class="btn btn-primary radius" type="submit" value="&nbsp;&nbsp;提交&nbsp;&nbsp;">
			</div>
		</div>
	</form>
</article>
<script src="http://files.cnblogs.com/china-li/jquery.form.js"></script>
<script type="text/javascript">
$(function(){
	$('.skin-minimal input').iCheck({
		checkboxClass: 'icheckbox-blue',
		radioClass: 'iradio-blue',
		increaseArea: '20%'
	});
	
	$("#form-member-add").validate({
		rules:{
			task_name:{
				required:true,
				minlength:2,
				maxlength:33
			},
			
		},
		onkeyup:false,
		focusCleanup:true,
		success:"valid",
		
	});
	$("#form-member-add").ajaxForm({
		type:'post',
		url:'{:U("taskAdd")}',
		success:function(data){
			if(data.status == 1){
				layer.msg(data.msg,{icon:6,time:1000});
				setTimeout(function(){
					var index = parent.layer.getFrameIndex(window.name);
					parent.location.reload();
					parent.layer.close(index);
				},1000);
			}else{
				layer.msg(data.msg,{icon:5,time:1000});
			}
		}
	});
});
</script> 

</block>